import request from '@/utils/request';
import { getPageSize } from '@/utils/common';

/**
 * 查询IC卡列表
 */
export async function selectIcCardList(params) {
  params.pageSize = params.pageSize || 20;
  return request(`/server/api/mds/mds-ic-card/selectMdsIcCardList`, {
    method: 'POST',
    body: params,
  });
}

/**
 * 查询详情
 */
export async function selectIcCardDetail(params) {
  return request(`/server/api/mds/mds-ic-card/viewMdsIcCardDetails`, {
    method: 'POST',
    body: params,
  });
}
//保存操作
export async function saveIcCard(params) {
  const { ...body } = params;
  const url = params.id ? 'updateMdsIcCard' : 'insertMdsIcCard';
  return request(`/server/api/mds/mds-ic-card/${url}`, {
    method: 'POST',
    body,
  });
}
//获取ic卡登录cookie
export async function getIcCardCookie(params) {
  const { ...body } = params;
  return request(`/getIcCardCookie`, {
    method: 'POST',
    body,
  });
}
// 获取随机数
export async function getRandom(params) {
  const { ...body } = params;
  return request(`/server/api/mds/mds-ic-card/getRandom`, {
    method: 'POST',
    body,
  });
}
//刷新cookie
//
export async function cookiesRefresh(params) {
  const { ...body } = params;
  return request(`/server/api/mds/mds-ic-card/icCardCookiesRefresh`, {
    method: 'POST',
    body,
  });
}
